extern "C" {
#include <math.h>
/******************************************************************************
 *                      Code generated with sympy 1.5.1                       *
 *                                                                            *
 *              See http://www.sympy.org/ for more information.               *
 *                                                                            *
 *                         This file is part of 'ekf'                         *
 ******************************************************************************/
void err_fun(double *nom_x, double *delta_x, double *out_7861167219672258566) {
   out_7861167219672258566[0] = delta_x[0] + nom_x[0];
   out_7861167219672258566[1] = delta_x[1] + nom_x[1];
   out_7861167219672258566[2] = delta_x[2] + nom_x[2];
   out_7861167219672258566[3] = -0.5*delta_x[3]*nom_x[4] - 0.5*delta_x[4]*nom_x[5] - 0.5*delta_x[5]*nom_x[6] + 1.0*nom_x[3];
   out_7861167219672258566[4] = 0.5*delta_x[3]*nom_x[3] + 0.5*delta_x[4]*nom_x[6] - 0.5*delta_x[5]*nom_x[5] + 1.0*nom_x[4];
   out_7861167219672258566[5] = -0.5*delta_x[3]*nom_x[6] + 0.5*delta_x[4]*nom_x[3] + 0.5*delta_x[5]*nom_x[4] + 1.0*nom_x[5];
   out_7861167219672258566[6] = 0.5*delta_x[3]*nom_x[5] - 0.5*delta_x[4]*nom_x[4] + 0.5*delta_x[5]*nom_x[3] + 1.0*nom_x[6];
   out_7861167219672258566[7] = delta_x[6] + nom_x[7];
   out_7861167219672258566[8] = delta_x[7] + nom_x[8];
   out_7861167219672258566[9] = delta_x[8] + nom_x[9];
   out_7861167219672258566[10] = delta_x[9] + nom_x[10];
   out_7861167219672258566[11] = delta_x[10] + nom_x[11];
   out_7861167219672258566[12] = delta_x[11] + nom_x[12];
   out_7861167219672258566[13] = delta_x[12] + nom_x[13];
   out_7861167219672258566[14] = delta_x[13] + nom_x[14];
   out_7861167219672258566[15] = delta_x[14] + nom_x[15];
   out_7861167219672258566[16] = delta_x[15] + nom_x[16];
   out_7861167219672258566[17] = delta_x[16] + nom_x[17];
   out_7861167219672258566[18] = delta_x[17] + nom_x[18];
   out_7861167219672258566[19] = delta_x[18] + nom_x[19];
   out_7861167219672258566[20] = delta_x[19] + nom_x[20];
   out_7861167219672258566[21] = delta_x[20] + nom_x[21];
   out_7861167219672258566[22] = delta_x[21] + nom_x[22];
}
void inv_err_fun(double *nom_x, double *true_x, double *out_4169199458110130867) {
   out_4169199458110130867[0] = -nom_x[0] + true_x[0];
   out_4169199458110130867[1] = -nom_x[1] + true_x[1];
   out_4169199458110130867[2] = -nom_x[2] + true_x[2];
   out_4169199458110130867[3] = 2*nom_x[3]*true_x[4] - 2*nom_x[4]*true_x[3] + 2*nom_x[5]*true_x[6] - 2*nom_x[6]*true_x[5];
   out_4169199458110130867[4] = 2*nom_x[3]*true_x[5] - 2*nom_x[4]*true_x[6] - 2*nom_x[5]*true_x[3] + 2*nom_x[6]*true_x[4];
   out_4169199458110130867[5] = 2*nom_x[3]*true_x[6] + 2*nom_x[4]*true_x[5] - 2*nom_x[5]*true_x[4] - 2*nom_x[6]*true_x[3];
   out_4169199458110130867[6] = -nom_x[7] + true_x[7];
   out_4169199458110130867[7] = -nom_x[8] + true_x[8];
   out_4169199458110130867[8] = -nom_x[9] + true_x[9];
   out_4169199458110130867[9] = -nom_x[10] + true_x[10];
   out_4169199458110130867[10] = -nom_x[11] + true_x[11];
   out_4169199458110130867[11] = -nom_x[12] + true_x[12];
   out_4169199458110130867[12] = -nom_x[13] + true_x[13];
   out_4169199458110130867[13] = -nom_x[14] + true_x[14];
   out_4169199458110130867[14] = -nom_x[15] + true_x[15];
   out_4169199458110130867[15] = -nom_x[16] + true_x[16];
   out_4169199458110130867[16] = -nom_x[17] + true_x[17];
   out_4169199458110130867[17] = -nom_x[18] + true_x[18];
   out_4169199458110130867[18] = -nom_x[19] + true_x[19];
   out_4169199458110130867[19] = -nom_x[20] + true_x[20];
   out_4169199458110130867[20] = -nom_x[21] + true_x[21];
   out_4169199458110130867[21] = -nom_x[22] + true_x[22];
}
void H_mod_fun(double *state, double *out_4010408429597161981) {
   out_4010408429597161981[0] = 1.0;
   out_4010408429597161981[1] = 0.0;
   out_4010408429597161981[2] = 0.0;
   out_4010408429597161981[3] = 0.0;
   out_4010408429597161981[4] = 0.0;
   out_4010408429597161981[5] = 0.0;
   out_4010408429597161981[6] = 0.0;
   out_4010408429597161981[7] = 0.0;
   out_4010408429597161981[8] = 0.0;
   out_4010408429597161981[9] = 0.0;
   out_4010408429597161981[10] = 0.0;
   out_4010408429597161981[11] = 0.0;
   out_4010408429597161981[12] = 0.0;
   out_4010408429597161981[13] = 0.0;
   out_4010408429597161981[14] = 0.0;
   out_4010408429597161981[15] = 0.0;
   out_4010408429597161981[16] = 0.0;
   out_4010408429597161981[17] = 0.0;
   out_4010408429597161981[18] = 0.0;
   out_4010408429597161981[19] = 0.0;
   out_4010408429597161981[20] = 0.0;
   out_4010408429597161981[21] = 0.0;
   out_4010408429597161981[22] = 0.0;
   out_4010408429597161981[23] = 1.0;
   out_4010408429597161981[24] = 0.0;
   out_4010408429597161981[25] = 0.0;
   out_4010408429597161981[26] = 0.0;
   out_4010408429597161981[27] = 0.0;
   out_4010408429597161981[28] = 0.0;
   out_4010408429597161981[29] = 0.0;
   out_4010408429597161981[30] = 0.0;
   out_4010408429597161981[31] = 0.0;
   out_4010408429597161981[32] = 0.0;
   out_4010408429597161981[33] = 0.0;
   out_4010408429597161981[34] = 0.0;
   out_4010408429597161981[35] = 0.0;
   out_4010408429597161981[36] = 0.0;
   out_4010408429597161981[37] = 0.0;
   out_4010408429597161981[38] = 0.0;
   out_4010408429597161981[39] = 0.0;
   out_4010408429597161981[40] = 0.0;
   out_4010408429597161981[41] = 0.0;
   out_4010408429597161981[42] = 0.0;
   out_4010408429597161981[43] = 0.0;
   out_4010408429597161981[44] = 0.0;
   out_4010408429597161981[45] = 0.0;
   out_4010408429597161981[46] = 1.0;
   out_4010408429597161981[47] = 0.0;
   out_4010408429597161981[48] = 0.0;
   out_4010408429597161981[49] = 0.0;
   out_4010408429597161981[50] = 0.0;
   out_4010408429597161981[51] = 0.0;
   out_4010408429597161981[52] = 0.0;
   out_4010408429597161981[53] = 0.0;
   out_4010408429597161981[54] = 0.0;
   out_4010408429597161981[55] = 0.0;
   out_4010408429597161981[56] = 0.0;
   out_4010408429597161981[57] = 0.0;
   out_4010408429597161981[58] = 0.0;
   out_4010408429597161981[59] = 0.0;
   out_4010408429597161981[60] = 0.0;
   out_4010408429597161981[61] = 0.0;
   out_4010408429597161981[62] = 0.0;
   out_4010408429597161981[63] = 0.0;
   out_4010408429597161981[64] = 0.0;
   out_4010408429597161981[65] = 0.0;
   out_4010408429597161981[66] = 0.0;
   out_4010408429597161981[67] = 0.0;
   out_4010408429597161981[68] = 0.0;
   out_4010408429597161981[69] = -0.5*state[4];
   out_4010408429597161981[70] = -0.5*state[5];
   out_4010408429597161981[71] = -0.5*state[6];
   out_4010408429597161981[72] = 0.0;
   out_4010408429597161981[73] = 0.0;
   out_4010408429597161981[74] = 0.0;
   out_4010408429597161981[75] = 0.0;
   out_4010408429597161981[76] = 0.0;
   out_4010408429597161981[77] = 0.0;
   out_4010408429597161981[78] = 0.0;
   out_4010408429597161981[79] = 0.0;
   out_4010408429597161981[80] = 0.0;
   out_4010408429597161981[81] = 0.0;
   out_4010408429597161981[82] = 0.0;
   out_4010408429597161981[83] = 0.0;
   out_4010408429597161981[84] = 0.0;
   out_4010408429597161981[85] = 0.0;
   out_4010408429597161981[86] = 0.0;
   out_4010408429597161981[87] = 0.0;
   out_4010408429597161981[88] = 0.0;
   out_4010408429597161981[89] = 0.0;
   out_4010408429597161981[90] = 0.0;
   out_4010408429597161981[91] = 0.5*state[3];
   out_4010408429597161981[92] = 0.5*state[6];
   out_4010408429597161981[93] = -0.5*state[5];
   out_4010408429597161981[94] = 0.0;
   out_4010408429597161981[95] = 0.0;
   out_4010408429597161981[96] = 0.0;
   out_4010408429597161981[97] = 0.0;
   out_4010408429597161981[98] = 0.0;
   out_4010408429597161981[99] = 0.0;
   out_4010408429597161981[100] = 0.0;
   out_4010408429597161981[101] = 0.0;
   out_4010408429597161981[102] = 0.0;
   out_4010408429597161981[103] = 0.0;
   out_4010408429597161981[104] = 0.0;
   out_4010408429597161981[105] = 0.0;
   out_4010408429597161981[106] = 0.0;
   out_4010408429597161981[107] = 0.0;
   out_4010408429597161981[108] = 0.0;
   out_4010408429597161981[109] = 0.0;
   out_4010408429597161981[110] = 0.0;
   out_4010408429597161981[111] = 0.0;
   out_4010408429597161981[112] = 0.0;
   out_4010408429597161981[113] = -0.5*state[6];
   out_4010408429597161981[114] = 0.5*state[3];
   out_4010408429597161981[115] = 0.5*state[4];
   out_4010408429597161981[116] = 0.0;
   out_4010408429597161981[117] = 0.0;
   out_4010408429597161981[118] = 0.0;
   out_4010408429597161981[119] = 0.0;
   out_4010408429597161981[120] = 0.0;
   out_4010408429597161981[121] = 0.0;
   out_4010408429597161981[122] = 0.0;
   out_4010408429597161981[123] = 0.0;
   out_4010408429597161981[124] = 0.0;
   out_4010408429597161981[125] = 0.0;
   out_4010408429597161981[126] = 0.0;
   out_4010408429597161981[127] = 0.0;
   out_4010408429597161981[128] = 0.0;
   out_4010408429597161981[129] = 0.0;
   out_4010408429597161981[130] = 0.0;
   out_4010408429597161981[131] = 0.0;
   out_4010408429597161981[132] = 0.0;
   out_4010408429597161981[133] = 0.0;
   out_4010408429597161981[134] = 0.0;
   out_4010408429597161981[135] = 0.5*state[5];
   out_4010408429597161981[136] = -0.5*state[4];
   out_4010408429597161981[137] = 0.5*state[3];
   out_4010408429597161981[138] = 0.0;
   out_4010408429597161981[139] = 0.0;
   out_4010408429597161981[140] = 0.0;
   out_4010408429597161981[141] = 0.0;
   out_4010408429597161981[142] = 0.0;
   out_4010408429597161981[143] = 0.0;
   out_4010408429597161981[144] = 0.0;
   out_4010408429597161981[145] = 0.0;
   out_4010408429597161981[146] = 0.0;
   out_4010408429597161981[147] = 0.0;
   out_4010408429597161981[148] = 0.0;
   out_4010408429597161981[149] = 0.0;
   out_4010408429597161981[150] = 0.0;
   out_4010408429597161981[151] = 0.0;
   out_4010408429597161981[152] = 0.0;
   out_4010408429597161981[153] = 0.0;
   out_4010408429597161981[154] = 0.0;
   out_4010408429597161981[155] = 0.0;
   out_4010408429597161981[156] = 0.0;
   out_4010408429597161981[157] = 0.0;
   out_4010408429597161981[158] = 0.0;
   out_4010408429597161981[159] = 0.0;
   out_4010408429597161981[160] = 1.0;
   out_4010408429597161981[161] = 0.0;
   out_4010408429597161981[162] = 0.0;
   out_4010408429597161981[163] = 0.0;
   out_4010408429597161981[164] = 0.0;
   out_4010408429597161981[165] = 0.0;
   out_4010408429597161981[166] = 0.0;
   out_4010408429597161981[167] = 0.0;
   out_4010408429597161981[168] = 0.0;
   out_4010408429597161981[169] = 0.0;
   out_4010408429597161981[170] = 0.0;
   out_4010408429597161981[171] = 0.0;
   out_4010408429597161981[172] = 0.0;
   out_4010408429597161981[173] = 0.0;
   out_4010408429597161981[174] = 0.0;
   out_4010408429597161981[175] = 0.0;
   out_4010408429597161981[176] = 0.0;
   out_4010408429597161981[177] = 0.0;
   out_4010408429597161981[178] = 0.0;
   out_4010408429597161981[179] = 0.0;
   out_4010408429597161981[180] = 0.0;
   out_4010408429597161981[181] = 0.0;
   out_4010408429597161981[182] = 0.0;
   out_4010408429597161981[183] = 1.0;
   out_4010408429597161981[184] = 0.0;
   out_4010408429597161981[185] = 0.0;
   out_4010408429597161981[186] = 0.0;
   out_4010408429597161981[187] = 0.0;
   out_4010408429597161981[188] = 0.0;
   out_4010408429597161981[189] = 0.0;
   out_4010408429597161981[190] = 0.0;
   out_4010408429597161981[191] = 0.0;
   out_4010408429597161981[192] = 0.0;
   out_4010408429597161981[193] = 0.0;
   out_4010408429597161981[194] = 0.0;
   out_4010408429597161981[195] = 0.0;
   out_4010408429597161981[196] = 0.0;
   out_4010408429597161981[197] = 0.0;
   out_4010408429597161981[198] = 0.0;
   out_4010408429597161981[199] = 0.0;
   out_4010408429597161981[200] = 0.0;
   out_4010408429597161981[201] = 0.0;
   out_4010408429597161981[202] = 0.0;
   out_4010408429597161981[203] = 0.0;
   out_4010408429597161981[204] = 0.0;
   out_4010408429597161981[205] = 0.0;
   out_4010408429597161981[206] = 1.0;
   out_4010408429597161981[207] = 0.0;
   out_4010408429597161981[208] = 0.0;
   out_4010408429597161981[209] = 0.0;
   out_4010408429597161981[210] = 0.0;
   out_4010408429597161981[211] = 0.0;
   out_4010408429597161981[212] = 0.0;
   out_4010408429597161981[213] = 0.0;
   out_4010408429597161981[214] = 0.0;
   out_4010408429597161981[215] = 0.0;
   out_4010408429597161981[216] = 0.0;
   out_4010408429597161981[217] = 0.0;
   out_4010408429597161981[218] = 0.0;
   out_4010408429597161981[219] = 0.0;
   out_4010408429597161981[220] = 0.0;
   out_4010408429597161981[221] = 0.0;
   out_4010408429597161981[222] = 0.0;
   out_4010408429597161981[223] = 0.0;
   out_4010408429597161981[224] = 0.0;
   out_4010408429597161981[225] = 0.0;
   out_4010408429597161981[226] = 0.0;
   out_4010408429597161981[227] = 0.0;
   out_4010408429597161981[228] = 0.0;
   out_4010408429597161981[229] = 1.0;
   out_4010408429597161981[230] = 0.0;
   out_4010408429597161981[231] = 0.0;
   out_4010408429597161981[232] = 0.0;
   out_4010408429597161981[233] = 0.0;
   out_4010408429597161981[234] = 0.0;
   out_4010408429597161981[235] = 0.0;
   out_4010408429597161981[236] = 0.0;
   out_4010408429597161981[237] = 0.0;
   out_4010408429597161981[238] = 0.0;
   out_4010408429597161981[239] = 0.0;
   out_4010408429597161981[240] = 0.0;
   out_4010408429597161981[241] = 0.0;
   out_4010408429597161981[242] = 0.0;
   out_4010408429597161981[243] = 0.0;
   out_4010408429597161981[244] = 0.0;
   out_4010408429597161981[245] = 0.0;
   out_4010408429597161981[246] = 0.0;
   out_4010408429597161981[247] = 0.0;
   out_4010408429597161981[248] = 0.0;
   out_4010408429597161981[249] = 0.0;
   out_4010408429597161981[250] = 0.0;
   out_4010408429597161981[251] = 0.0;
   out_4010408429597161981[252] = 1.0;
   out_4010408429597161981[253] = 0.0;
   out_4010408429597161981[254] = 0.0;
   out_4010408429597161981[255] = 0.0;
   out_4010408429597161981[256] = 0.0;
   out_4010408429597161981[257] = 0.0;
   out_4010408429597161981[258] = 0.0;
   out_4010408429597161981[259] = 0.0;
   out_4010408429597161981[260] = 0.0;
   out_4010408429597161981[261] = 0.0;
   out_4010408429597161981[262] = 0.0;
   out_4010408429597161981[263] = 0.0;
   out_4010408429597161981[264] = 0.0;
   out_4010408429597161981[265] = 0.0;
   out_4010408429597161981[266] = 0.0;
   out_4010408429597161981[267] = 0.0;
   out_4010408429597161981[268] = 0.0;
   out_4010408429597161981[269] = 0.0;
   out_4010408429597161981[270] = 0.0;
   out_4010408429597161981[271] = 0.0;
   out_4010408429597161981[272] = 0.0;
   out_4010408429597161981[273] = 0.0;
   out_4010408429597161981[274] = 0.0;
   out_4010408429597161981[275] = 1.0;
   out_4010408429597161981[276] = 0.0;
   out_4010408429597161981[277] = 0.0;
   out_4010408429597161981[278] = 0.0;
   out_4010408429597161981[279] = 0.0;
   out_4010408429597161981[280] = 0.0;
   out_4010408429597161981[281] = 0.0;
   out_4010408429597161981[282] = 0.0;
   out_4010408429597161981[283] = 0.0;
   out_4010408429597161981[284] = 0.0;
   out_4010408429597161981[285] = 0.0;
   out_4010408429597161981[286] = 0.0;
   out_4010408429597161981[287] = 0.0;
   out_4010408429597161981[288] = 0.0;
   out_4010408429597161981[289] = 0.0;
   out_4010408429597161981[290] = 0.0;
   out_4010408429597161981[291] = 0.0;
   out_4010408429597161981[292] = 0.0;
   out_4010408429597161981[293] = 0.0;
   out_4010408429597161981[294] = 0.0;
   out_4010408429597161981[295] = 0.0;
   out_4010408429597161981[296] = 0.0;
   out_4010408429597161981[297] = 0.0;
   out_4010408429597161981[298] = 1.0;
   out_4010408429597161981[299] = 0.0;
   out_4010408429597161981[300] = 0.0;
   out_4010408429597161981[301] = 0.0;
   out_4010408429597161981[302] = 0.0;
   out_4010408429597161981[303] = 0.0;
   out_4010408429597161981[304] = 0.0;
   out_4010408429597161981[305] = 0.0;
   out_4010408429597161981[306] = 0.0;
   out_4010408429597161981[307] = 0.0;
   out_4010408429597161981[308] = 0.0;
   out_4010408429597161981[309] = 0.0;
   out_4010408429597161981[310] = 0.0;
   out_4010408429597161981[311] = 0.0;
   out_4010408429597161981[312] = 0.0;
   out_4010408429597161981[313] = 0.0;
   out_4010408429597161981[314] = 0.0;
   out_4010408429597161981[315] = 0.0;
   out_4010408429597161981[316] = 0.0;
   out_4010408429597161981[317] = 0.0;
   out_4010408429597161981[318] = 0.0;
   out_4010408429597161981[319] = 0.0;
   out_4010408429597161981[320] = 0.0;
   out_4010408429597161981[321] = 1.0;
   out_4010408429597161981[322] = 0.0;
   out_4010408429597161981[323] = 0.0;
   out_4010408429597161981[324] = 0.0;
   out_4010408429597161981[325] = 0.0;
   out_4010408429597161981[326] = 0.0;
   out_4010408429597161981[327] = 0.0;
   out_4010408429597161981[328] = 0.0;
   out_4010408429597161981[329] = 0.0;
   out_4010408429597161981[330] = 0.0;
   out_4010408429597161981[331] = 0.0;
   out_4010408429597161981[332] = 0.0;
   out_4010408429597161981[333] = 0.0;
   out_4010408429597161981[334] = 0.0;
   out_4010408429597161981[335] = 0.0;
   out_4010408429597161981[336] = 0.0;
   out_4010408429597161981[337] = 0.0;
   out_4010408429597161981[338] = 0.0;
   out_4010408429597161981[339] = 0.0;
   out_4010408429597161981[340] = 0.0;
   out_4010408429597161981[341] = 0.0;
   out_4010408429597161981[342] = 0.0;
   out_4010408429597161981[343] = 0.0;
   out_4010408429597161981[344] = 1.0;
   out_4010408429597161981[345] = 0.0;
   out_4010408429597161981[346] = 0.0;
   out_4010408429597161981[347] = 0.0;
   out_4010408429597161981[348] = 0.0;
   out_4010408429597161981[349] = 0.0;
   out_4010408429597161981[350] = 0.0;
   out_4010408429597161981[351] = 0.0;
   out_4010408429597161981[352] = 0.0;
   out_4010408429597161981[353] = 0.0;
   out_4010408429597161981[354] = 0.0;
   out_4010408429597161981[355] = 0.0;
   out_4010408429597161981[356] = 0.0;
   out_4010408429597161981[357] = 0.0;
   out_4010408429597161981[358] = 0.0;
   out_4010408429597161981[359] = 0.0;
   out_4010408429597161981[360] = 0.0;
   out_4010408429597161981[361] = 0.0;
   out_4010408429597161981[362] = 0.0;
   out_4010408429597161981[363] = 0.0;
   out_4010408429597161981[364] = 0.0;
   out_4010408429597161981[365] = 0.0;
   out_4010408429597161981[366] = 0.0;
   out_4010408429597161981[367] = 1.0;
   out_4010408429597161981[368] = 0.0;
   out_4010408429597161981[369] = 0.0;
   out_4010408429597161981[370] = 0.0;
   out_4010408429597161981[371] = 0.0;
   out_4010408429597161981[372] = 0.0;
   out_4010408429597161981[373] = 0.0;
   out_4010408429597161981[374] = 0.0;
   out_4010408429597161981[375] = 0.0;
   out_4010408429597161981[376] = 0.0;
   out_4010408429597161981[377] = 0.0;
   out_4010408429597161981[378] = 0.0;
   out_4010408429597161981[379] = 0.0;
   out_4010408429597161981[380] = 0.0;
   out_4010408429597161981[381] = 0.0;
   out_4010408429597161981[382] = 0.0;
   out_4010408429597161981[383] = 0.0;
   out_4010408429597161981[384] = 0.0;
   out_4010408429597161981[385] = 0.0;
   out_4010408429597161981[386] = 0.0;
   out_4010408429597161981[387] = 0.0;
   out_4010408429597161981[388] = 0.0;
   out_4010408429597161981[389] = 0.0;
   out_4010408429597161981[390] = 1.0;
   out_4010408429597161981[391] = 0.0;
   out_4010408429597161981[392] = 0.0;
   out_4010408429597161981[393] = 0.0;
   out_4010408429597161981[394] = 0.0;
   out_4010408429597161981[395] = 0.0;
   out_4010408429597161981[396] = 0.0;
   out_4010408429597161981[397] = 0.0;
   out_4010408429597161981[398] = 0.0;
   out_4010408429597161981[399] = 0.0;
   out_4010408429597161981[400] = 0.0;
   out_4010408429597161981[401] = 0.0;
   out_4010408429597161981[402] = 0.0;
   out_4010408429597161981[403] = 0.0;
   out_4010408429597161981[404] = 0.0;
   out_4010408429597161981[405] = 0.0;
   out_4010408429597161981[406] = 0.0;
   out_4010408429597161981[407] = 0.0;
   out_4010408429597161981[408] = 0.0;
   out_4010408429597161981[409] = 0.0;
   out_4010408429597161981[410] = 0.0;
   out_4010408429597161981[411] = 0.0;
   out_4010408429597161981[412] = 0.0;
   out_4010408429597161981[413] = 1.0;
   out_4010408429597161981[414] = 0.0;
   out_4010408429597161981[415] = 0.0;
   out_4010408429597161981[416] = 0.0;
   out_4010408429597161981[417] = 0.0;
   out_4010408429597161981[418] = 0.0;
   out_4010408429597161981[419] = 0.0;
   out_4010408429597161981[420] = 0.0;
   out_4010408429597161981[421] = 0.0;
   out_4010408429597161981[422] = 0.0;
   out_4010408429597161981[423] = 0.0;
   out_4010408429597161981[424] = 0.0;
   out_4010408429597161981[425] = 0.0;
   out_4010408429597161981[426] = 0.0;
   out_4010408429597161981[427] = 0.0;
   out_4010408429597161981[428] = 0.0;
   out_4010408429597161981[429] = 0.0;
   out_4010408429597161981[430] = 0.0;
   out_4010408429597161981[431] = 0.0;
   out_4010408429597161981[432] = 0.0;
   out_4010408429597161981[433] = 0.0;
   out_4010408429597161981[434] = 0.0;
   out_4010408429597161981[435] = 0.0;
   out_4010408429597161981[436] = 1.0;
   out_4010408429597161981[437] = 0.0;
   out_4010408429597161981[438] = 0.0;
   out_4010408429597161981[439] = 0.0;
   out_4010408429597161981[440] = 0.0;
   out_4010408429597161981[441] = 0.0;
   out_4010408429597161981[442] = 0.0;
   out_4010408429597161981[443] = 0.0;
   out_4010408429597161981[444] = 0.0;
   out_4010408429597161981[445] = 0.0;
   out_4010408429597161981[446] = 0.0;
   out_4010408429597161981[447] = 0.0;
   out_4010408429597161981[448] = 0.0;
   out_4010408429597161981[449] = 0.0;
   out_4010408429597161981[450] = 0.0;
   out_4010408429597161981[451] = 0.0;
   out_4010408429597161981[452] = 0.0;
   out_4010408429597161981[453] = 0.0;
   out_4010408429597161981[454] = 0.0;
   out_4010408429597161981[455] = 0.0;
   out_4010408429597161981[456] = 0.0;
   out_4010408429597161981[457] = 0.0;
   out_4010408429597161981[458] = 0.0;
   out_4010408429597161981[459] = 1.0;
   out_4010408429597161981[460] = 0.0;
   out_4010408429597161981[461] = 0.0;
   out_4010408429597161981[462] = 0.0;
   out_4010408429597161981[463] = 0.0;
   out_4010408429597161981[464] = 0.0;
   out_4010408429597161981[465] = 0.0;
   out_4010408429597161981[466] = 0.0;
   out_4010408429597161981[467] = 0.0;
   out_4010408429597161981[468] = 0.0;
   out_4010408429597161981[469] = 0.0;
   out_4010408429597161981[470] = 0.0;
   out_4010408429597161981[471] = 0.0;
   out_4010408429597161981[472] = 0.0;
   out_4010408429597161981[473] = 0.0;
   out_4010408429597161981[474] = 0.0;
   out_4010408429597161981[475] = 0.0;
   out_4010408429597161981[476] = 0.0;
   out_4010408429597161981[477] = 0.0;
   out_4010408429597161981[478] = 0.0;
   out_4010408429597161981[479] = 0.0;
   out_4010408429597161981[480] = 0.0;
   out_4010408429597161981[481] = 0.0;
   out_4010408429597161981[482] = 1.0;
   out_4010408429597161981[483] = 0.0;
   out_4010408429597161981[484] = 0.0;
   out_4010408429597161981[485] = 0.0;
   out_4010408429597161981[486] = 0.0;
   out_4010408429597161981[487] = 0.0;
   out_4010408429597161981[488] = 0.0;
   out_4010408429597161981[489] = 0.0;
   out_4010408429597161981[490] = 0.0;
   out_4010408429597161981[491] = 0.0;
   out_4010408429597161981[492] = 0.0;
   out_4010408429597161981[493] = 0.0;
   out_4010408429597161981[494] = 0.0;
   out_4010408429597161981[495] = 0.0;
   out_4010408429597161981[496] = 0.0;
   out_4010408429597161981[497] = 0.0;
   out_4010408429597161981[498] = 0.0;
   out_4010408429597161981[499] = 0.0;
   out_4010408429597161981[500] = 0.0;
   out_4010408429597161981[501] = 0.0;
   out_4010408429597161981[502] = 0.0;
   out_4010408429597161981[503] = 0.0;
   out_4010408429597161981[504] = 0.0;
   out_4010408429597161981[505] = 1.0;
}
void f_fun(double *state, double dt, double *out_8715827380682604135) {
   out_8715827380682604135[0] = dt*state[7] + state[0];
   out_8715827380682604135[1] = dt*state[8] + state[1];
   out_8715827380682604135[2] = dt*state[9] + state[2];
   out_8715827380682604135[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3];
   out_8715827380682604135[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4];
   out_8715827380682604135[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5];
   out_8715827380682604135[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6];
   out_8715827380682604135[7] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[19] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[18] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[17]) + state[7];
   out_8715827380682604135[8] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[19] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[18]) + state[8];
   out_8715827380682604135[9] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[17] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[19]) + state[9];
   out_8715827380682604135[10] = state[10];
   out_8715827380682604135[11] = state[11];
   out_8715827380682604135[12] = state[12];
   out_8715827380682604135[13] = state[13];
   out_8715827380682604135[14] = state[14];
   out_8715827380682604135[15] = state[15];
   out_8715827380682604135[16] = state[16];
   out_8715827380682604135[17] = state[17];
   out_8715827380682604135[18] = state[18];
   out_8715827380682604135[19] = state[19];
   out_8715827380682604135[20] = state[20];
   out_8715827380682604135[21] = state[21];
   out_8715827380682604135[22] = state[22];
}
void F_fun(double *state, double dt, double *out_1766557707574631373) {
   out_1766557707574631373[0] = 1;
   out_1766557707574631373[1] = 0;
   out_1766557707574631373[2] = 0;
   out_1766557707574631373[3] = 0;
   out_1766557707574631373[4] = 0;
   out_1766557707574631373[5] = 0;
   out_1766557707574631373[6] = dt;
   out_1766557707574631373[7] = 0;
   out_1766557707574631373[8] = 0;
   out_1766557707574631373[9] = 0;
   out_1766557707574631373[10] = 0;
   out_1766557707574631373[11] = 0;
   out_1766557707574631373[12] = 0;
   out_1766557707574631373[13] = 0;
   out_1766557707574631373[14] = 0;
   out_1766557707574631373[15] = 0;
   out_1766557707574631373[16] = 0;
   out_1766557707574631373[17] = 0;
   out_1766557707574631373[18] = 0;
   out_1766557707574631373[19] = 0;
   out_1766557707574631373[20] = 0;
   out_1766557707574631373[21] = 0;
   out_1766557707574631373[22] = 0;
   out_1766557707574631373[23] = 1;
   out_1766557707574631373[24] = 0;
   out_1766557707574631373[25] = 0;
   out_1766557707574631373[26] = 0;
   out_1766557707574631373[27] = 0;
   out_1766557707574631373[28] = 0;
   out_1766557707574631373[29] = dt;
   out_1766557707574631373[30] = 0;
   out_1766557707574631373[31] = 0;
   out_1766557707574631373[32] = 0;
   out_1766557707574631373[33] = 0;
   out_1766557707574631373[34] = 0;
   out_1766557707574631373[35] = 0;
   out_1766557707574631373[36] = 0;
   out_1766557707574631373[37] = 0;
   out_1766557707574631373[38] = 0;
   out_1766557707574631373[39] = 0;
   out_1766557707574631373[40] = 0;
   out_1766557707574631373[41] = 0;
   out_1766557707574631373[42] = 0;
   out_1766557707574631373[43] = 0;
   out_1766557707574631373[44] = 0;
   out_1766557707574631373[45] = 0;
   out_1766557707574631373[46] = 1;
   out_1766557707574631373[47] = 0;
   out_1766557707574631373[48] = 0;
   out_1766557707574631373[49] = 0;
   out_1766557707574631373[50] = 0;
   out_1766557707574631373[51] = 0;
   out_1766557707574631373[52] = dt;
   out_1766557707574631373[53] = 0;
   out_1766557707574631373[54] = 0;
   out_1766557707574631373[55] = 0;
   out_1766557707574631373[56] = 0;
   out_1766557707574631373[57] = 0;
   out_1766557707574631373[58] = 0;
   out_1766557707574631373[59] = 0;
   out_1766557707574631373[60] = 0;
   out_1766557707574631373[61] = 0;
   out_1766557707574631373[62] = 0;
   out_1766557707574631373[63] = 0;
   out_1766557707574631373[64] = 0;
   out_1766557707574631373[65] = 0;
   out_1766557707574631373[66] = 0;
   out_1766557707574631373[67] = 0;
   out_1766557707574631373[68] = 0;
   out_1766557707574631373[69] = 1;
   out_1766557707574631373[70] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[11] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]);
   out_1766557707574631373[71] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[12] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[10] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[11]);
   out_1766557707574631373[72] = 0;
   out_1766557707574631373[73] = 0;
   out_1766557707574631373[74] = 0;
   out_1766557707574631373[75] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
   out_1766557707574631373[76] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]);
   out_1766557707574631373[77] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]);
   out_1766557707574631373[78] = 0;
   out_1766557707574631373[79] = 0;
   out_1766557707574631373[80] = 0;
   out_1766557707574631373[81] = 0;
   out_1766557707574631373[82] = 0;
   out_1766557707574631373[83] = 0;
   out_1766557707574631373[84] = 0;
   out_1766557707574631373[85] = 0;
   out_1766557707574631373[86] = 0;
   out_1766557707574631373[87] = 0;
   out_1766557707574631373[88] = 0;
   out_1766557707574631373[89] = 0;
   out_1766557707574631373[90] = 0;
   out_1766557707574631373[91] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[11] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]);
   out_1766557707574631373[92] = 1;
   out_1766557707574631373[93] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[12] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[11] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[10]);
   out_1766557707574631373[94] = 0;
   out_1766557707574631373[95] = 0;
   out_1766557707574631373[96] = 0;
   out_1766557707574631373[97] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]);
   out_1766557707574631373[98] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
   out_1766557707574631373[99] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]);
   out_1766557707574631373[100] = 0;
   out_1766557707574631373[101] = 0;
   out_1766557707574631373[102] = 0;
   out_1766557707574631373[103] = 0;
   out_1766557707574631373[104] = 0;
   out_1766557707574631373[105] = 0;
   out_1766557707574631373[106] = 0;
   out_1766557707574631373[107] = 0;
   out_1766557707574631373[108] = 0;
   out_1766557707574631373[109] = 0;
   out_1766557707574631373[110] = 0;
   out_1766557707574631373[111] = 0;
   out_1766557707574631373[112] = 0;
   out_1766557707574631373[113] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[12] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[10] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[11]);
   out_1766557707574631373[114] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[12] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[11] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[10]);
   out_1766557707574631373[115] = 1;
   out_1766557707574631373[116] = 0;
   out_1766557707574631373[117] = 0;
   out_1766557707574631373[118] = 0;
   out_1766557707574631373[119] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]);
   out_1766557707574631373[120] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]);
   out_1766557707574631373[121] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
   out_1766557707574631373[122] = 0;
   out_1766557707574631373[123] = 0;
   out_1766557707574631373[124] = 0;
   out_1766557707574631373[125] = 0;
   out_1766557707574631373[126] = 0;
   out_1766557707574631373[127] = 0;
   out_1766557707574631373[128] = 0;
   out_1766557707574631373[129] = 0;
   out_1766557707574631373[130] = 0;
   out_1766557707574631373[131] = 0;
   out_1766557707574631373[132] = 0;
   out_1766557707574631373[133] = 0;
   out_1766557707574631373[134] = 0;
   out_1766557707574631373[135] = 0;
   out_1766557707574631373[136] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[17] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[19]);
   out_1766557707574631373[137] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[19] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[17] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]);
   out_1766557707574631373[138] = 1;
   out_1766557707574631373[139] = 0;
   out_1766557707574631373[140] = 0;
   out_1766557707574631373[141] = 0;
   out_1766557707574631373[142] = 0;
   out_1766557707574631373[143] = 0;
   out_1766557707574631373[144] = 0;
   out_1766557707574631373[145] = 0;
   out_1766557707574631373[146] = 0;
   out_1766557707574631373[147] = 0;
   out_1766557707574631373[148] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
   out_1766557707574631373[149] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]);
   out_1766557707574631373[150] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]);
   out_1766557707574631373[151] = 0;
   out_1766557707574631373[152] = 0;
   out_1766557707574631373[153] = 0;
   out_1766557707574631373[154] = 0;
   out_1766557707574631373[155] = 0;
   out_1766557707574631373[156] = 0;
   out_1766557707574631373[157] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[18] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[17] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[19]);
   out_1766557707574631373[158] = 0;
   out_1766557707574631373[159] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[19] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[18] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[17]);
   out_1766557707574631373[160] = 0;
   out_1766557707574631373[161] = 1;
   out_1766557707574631373[162] = 0;
   out_1766557707574631373[163] = 0;
   out_1766557707574631373[164] = 0;
   out_1766557707574631373[165] = 0;
   out_1766557707574631373[166] = 0;
   out_1766557707574631373[167] = 0;
   out_1766557707574631373[168] = 0;
   out_1766557707574631373[169] = 0;
   out_1766557707574631373[170] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]);
   out_1766557707574631373[171] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
   out_1766557707574631373[172] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]);
   out_1766557707574631373[173] = 0;
   out_1766557707574631373[174] = 0;
   out_1766557707574631373[175] = 0;
   out_1766557707574631373[176] = 0;
   out_1766557707574631373[177] = 0;
   out_1766557707574631373[178] = 0;
   out_1766557707574631373[179] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[19] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[18]);
   out_1766557707574631373[180] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[19] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[18] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[17]);
   out_1766557707574631373[181] = 0;
   out_1766557707574631373[182] = 0;
   out_1766557707574631373[183] = 0;
   out_1766557707574631373[184] = 1;
   out_1766557707574631373[185] = 0;
   out_1766557707574631373[186] = 0;
   out_1766557707574631373[187] = 0;
   out_1766557707574631373[188] = 0;
   out_1766557707574631373[189] = 0;
   out_1766557707574631373[190] = 0;
   out_1766557707574631373[191] = 0;
   out_1766557707574631373[192] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]);
   out_1766557707574631373[193] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]);
   out_1766557707574631373[194] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
   out_1766557707574631373[195] = 0;
   out_1766557707574631373[196] = 0;
   out_1766557707574631373[197] = 0;
   out_1766557707574631373[198] = 0;
   out_1766557707574631373[199] = 0;
   out_1766557707574631373[200] = 0;
   out_1766557707574631373[201] = 0;
   out_1766557707574631373[202] = 0;
   out_1766557707574631373[203] = 0;
   out_1766557707574631373[204] = 0;
   out_1766557707574631373[205] = 0;
   out_1766557707574631373[206] = 0;
   out_1766557707574631373[207] = 1;
   out_1766557707574631373[208] = 0;
   out_1766557707574631373[209] = 0;
   out_1766557707574631373[210] = 0;
   out_1766557707574631373[211] = 0;
   out_1766557707574631373[212] = 0;
   out_1766557707574631373[213] = 0;
   out_1766557707574631373[214] = 0;
   out_1766557707574631373[215] = 0;
   out_1766557707574631373[216] = 0;
   out_1766557707574631373[217] = 0;
   out_1766557707574631373[218] = 0;
   out_1766557707574631373[219] = 0;
   out_1766557707574631373[220] = 0;
   out_1766557707574631373[221] = 0;
   out_1766557707574631373[222] = 0;
   out_1766557707574631373[223] = 0;
   out_1766557707574631373[224] = 0;
   out_1766557707574631373[225] = 0;
   out_1766557707574631373[226] = 0;
   out_1766557707574631373[227] = 0;
   out_1766557707574631373[228] = 0;
   out_1766557707574631373[229] = 0;
   out_1766557707574631373[230] = 1;
   out_1766557707574631373[231] = 0;
   out_1766557707574631373[232] = 0;
   out_1766557707574631373[233] = 0;
   out_1766557707574631373[234] = 0;
   out_1766557707574631373[235] = 0;
   out_1766557707574631373[236] = 0;
   out_1766557707574631373[237] = 0;
   out_1766557707574631373[238] = 0;
   out_1766557707574631373[239] = 0;
   out_1766557707574631373[240] = 0;
   out_1766557707574631373[241] = 0;
   out_1766557707574631373[242] = 0;
   out_1766557707574631373[243] = 0;
   out_1766557707574631373[244] = 0;
   out_1766557707574631373[245] = 0;
   out_1766557707574631373[246] = 0;
   out_1766557707574631373[247] = 0;
   out_1766557707574631373[248] = 0;
   out_1766557707574631373[249] = 0;
   out_1766557707574631373[250] = 0;
   out_1766557707574631373[251] = 0;
   out_1766557707574631373[252] = 0;
   out_1766557707574631373[253] = 1;
   out_1766557707574631373[254] = 0;
   out_1766557707574631373[255] = 0;
   out_1766557707574631373[256] = 0;
   out_1766557707574631373[257] = 0;
   out_1766557707574631373[258] = 0;
   out_1766557707574631373[259] = 0;
   out_1766557707574631373[260] = 0;
   out_1766557707574631373[261] = 0;
   out_1766557707574631373[262] = 0;
   out_1766557707574631373[263] = 0;
   out_1766557707574631373[264] = 0;
   out_1766557707574631373[265] = 0;
   out_1766557707574631373[266] = 0;
   out_1766557707574631373[267] = 0;
   out_1766557707574631373[268] = 0;
   out_1766557707574631373[269] = 0;
   out_1766557707574631373[270] = 0;
   out_1766557707574631373[271] = 0;
   out_1766557707574631373[272] = 0;
   out_1766557707574631373[273] = 0;
   out_1766557707574631373[274] = 0;
   out_1766557707574631373[275] = 0;
   out_1766557707574631373[276] = 1;
   out_1766557707574631373[277] = 0;
   out_1766557707574631373[278] = 0;
   out_1766557707574631373[279] = 0;
   out_1766557707574631373[280] = 0;
   out_1766557707574631373[281] = 0;
   out_1766557707574631373[282] = 0;
   out_1766557707574631373[283] = 0;
   out_1766557707574631373[284] = 0;
   out_1766557707574631373[285] = 0;
   out_1766557707574631373[286] = 0;
   out_1766557707574631373[287] = 0;
   out_1766557707574631373[288] = 0;
   out_1766557707574631373[289] = 0;
   out_1766557707574631373[290] = 0;
   out_1766557707574631373[291] = 0;
   out_1766557707574631373[292] = 0;
   out_1766557707574631373[293] = 0;
   out_1766557707574631373[294] = 0;
   out_1766557707574631373[295] = 0;
   out_1766557707574631373[296] = 0;
   out_1766557707574631373[297] = 0;
   out_1766557707574631373[298] = 0;
   out_1766557707574631373[299] = 1;
   out_1766557707574631373[300] = 0;
   out_1766557707574631373[301] = 0;
   out_1766557707574631373[302] = 0;
   out_1766557707574631373[303] = 0;
   out_1766557707574631373[304] = 0;
   out_1766557707574631373[305] = 0;
   out_1766557707574631373[306] = 0;
   out_1766557707574631373[307] = 0;
   out_1766557707574631373[308] = 0;
   out_1766557707574631373[309] = 0;
   out_1766557707574631373[310] = 0;
   out_1766557707574631373[311] = 0;
   out_1766557707574631373[312] = 0;
   out_1766557707574631373[313] = 0;
   out_1766557707574631373[314] = 0;
   out_1766557707574631373[315] = 0;
   out_1766557707574631373[316] = 0;
   out_1766557707574631373[317] = 0;
   out_1766557707574631373[318] = 0;
   out_1766557707574631373[319] = 0;
   out_1766557707574631373[320] = 0;
   out_1766557707574631373[321] = 0;
   out_1766557707574631373[322] = 1;
   out_1766557707574631373[323] = 0;
   out_1766557707574631373[324] = 0;
   out_1766557707574631373[325] = 0;
   out_1766557707574631373[326] = 0;
   out_1766557707574631373[327] = 0;
   out_1766557707574631373[328] = 0;
   out_1766557707574631373[329] = 0;
   out_1766557707574631373[330] = 0;
   out_1766557707574631373[331] = 0;
   out_1766557707574631373[332] = 0;
   out_1766557707574631373[333] = 0;
   out_1766557707574631373[334] = 0;
   out_1766557707574631373[335] = 0;
   out_1766557707574631373[336] = 0;
   out_1766557707574631373[337] = 0;
   out_1766557707574631373[338] = 0;
   out_1766557707574631373[339] = 0;
   out_1766557707574631373[340] = 0;
   out_1766557707574631373[341] = 0;
   out_1766557707574631373[342] = 0;
   out_1766557707574631373[343] = 0;
   out_1766557707574631373[344] = 0;
   out_1766557707574631373[345] = 1;
   out_1766557707574631373[346] = 0;
   out_1766557707574631373[347] = 0;
   out_1766557707574631373[348] = 0;
   out_1766557707574631373[349] = 0;
   out_1766557707574631373[350] = 0;
   out_1766557707574631373[351] = 0;
   out_1766557707574631373[352] = 0;
   out_1766557707574631373[353] = 0;
   out_1766557707574631373[354] = 0;
   out_1766557707574631373[355] = 0;
   out_1766557707574631373[356] = 0;
   out_1766557707574631373[357] = 0;
   out_1766557707574631373[358] = 0;
   out_1766557707574631373[359] = 0;
   out_1766557707574631373[360] = 0;
   out_1766557707574631373[361] = 0;
   out_1766557707574631373[362] = 0;
   out_1766557707574631373[363] = 0;
   out_1766557707574631373[364] = 0;
   out_1766557707574631373[365] = 0;
   out_1766557707574631373[366] = 0;
   out_1766557707574631373[367] = 0;
   out_1766557707574631373[368] = 1;
   out_1766557707574631373[369] = 0;
   out_1766557707574631373[370] = 0;
   out_1766557707574631373[371] = 0;
   out_1766557707574631373[372] = 0;
   out_1766557707574631373[373] = 0;
   out_1766557707574631373[374] = 0;
   out_1766557707574631373[375] = 0;
   out_1766557707574631373[376] = 0;
   out_1766557707574631373[377] = 0;
   out_1766557707574631373[378] = 0;
   out_1766557707574631373[379] = 0;
   out_1766557707574631373[380] = 0;
   out_1766557707574631373[381] = 0;
   out_1766557707574631373[382] = 0;
   out_1766557707574631373[383] = 0;
   out_1766557707574631373[384] = 0;
   out_1766557707574631373[385] = 0;
   out_1766557707574631373[386] = 0;
   out_1766557707574631373[387] = 0;
   out_1766557707574631373[388] = 0;
   out_1766557707574631373[389] = 0;
   out_1766557707574631373[390] = 0;
   out_1766557707574631373[391] = 1;
   out_1766557707574631373[392] = 0;
   out_1766557707574631373[393] = 0;
   out_1766557707574631373[394] = 0;
   out_1766557707574631373[395] = 0;
   out_1766557707574631373[396] = 0;
   out_1766557707574631373[397] = 0;
   out_1766557707574631373[398] = 0;
   out_1766557707574631373[399] = 0;
   out_1766557707574631373[400] = 0;
   out_1766557707574631373[401] = 0;
   out_1766557707574631373[402] = 0;
   out_1766557707574631373[403] = 0;
   out_1766557707574631373[404] = 0;
   out_1766557707574631373[405] = 0;
   out_1766557707574631373[406] = 0;
   out_1766557707574631373[407] = 0;
   out_1766557707574631373[408] = 0;
   out_1766557707574631373[409] = 0;
   out_1766557707574631373[410] = 0;
   out_1766557707574631373[411] = 0;
   out_1766557707574631373[412] = 0;
   out_1766557707574631373[413] = 0;
   out_1766557707574631373[414] = 1;
   out_1766557707574631373[415] = 0;
   out_1766557707574631373[416] = 0;
   out_1766557707574631373[417] = 0;
   out_1766557707574631373[418] = 0;
   out_1766557707574631373[419] = 0;
   out_1766557707574631373[420] = 0;
   out_1766557707574631373[421] = 0;
   out_1766557707574631373[422] = 0;
   out_1766557707574631373[423] = 0;
   out_1766557707574631373[424] = 0;
   out_1766557707574631373[425] = 0;
   out_1766557707574631373[426] = 0;
   out_1766557707574631373[427] = 0;
   out_1766557707574631373[428] = 0;
   out_1766557707574631373[429] = 0;
   out_1766557707574631373[430] = 0;
   out_1766557707574631373[431] = 0;
   out_1766557707574631373[432] = 0;
   out_1766557707574631373[433] = 0;
   out_1766557707574631373[434] = 0;
   out_1766557707574631373[435] = 0;
   out_1766557707574631373[436] = 0;
   out_1766557707574631373[437] = 1;
   out_1766557707574631373[438] = 0;
   out_1766557707574631373[439] = 0;
   out_1766557707574631373[440] = 0;
   out_1766557707574631373[441] = 0;
   out_1766557707574631373[442] = 0;
   out_1766557707574631373[443] = 0;
   out_1766557707574631373[444] = 0;
   out_1766557707574631373[445] = 0;
   out_1766557707574631373[446] = 0;
   out_1766557707574631373[447] = 0;
   out_1766557707574631373[448] = 0;
   out_1766557707574631373[449] = 0;
   out_1766557707574631373[450] = 0;
   out_1766557707574631373[451] = 0;
   out_1766557707574631373[452] = 0;
   out_1766557707574631373[453] = 0;
   out_1766557707574631373[454] = 0;
   out_1766557707574631373[455] = 0;
   out_1766557707574631373[456] = 0;
   out_1766557707574631373[457] = 0;
   out_1766557707574631373[458] = 0;
   out_1766557707574631373[459] = 0;
   out_1766557707574631373[460] = 1;
   out_1766557707574631373[461] = 0;
   out_1766557707574631373[462] = 0;
   out_1766557707574631373[463] = 0;
   out_1766557707574631373[464] = 0;
   out_1766557707574631373[465] = 0;
   out_1766557707574631373[466] = 0;
   out_1766557707574631373[467] = 0;
   out_1766557707574631373[468] = 0;
   out_1766557707574631373[469] = 0;
   out_1766557707574631373[470] = 0;
   out_1766557707574631373[471] = 0;
   out_1766557707574631373[472] = 0;
   out_1766557707574631373[473] = 0;
   out_1766557707574631373[474] = 0;
   out_1766557707574631373[475] = 0;
   out_1766557707574631373[476] = 0;
   out_1766557707574631373[477] = 0;
   out_1766557707574631373[478] = 0;
   out_1766557707574631373[479] = 0;
   out_1766557707574631373[480] = 0;
   out_1766557707574631373[481] = 0;
   out_1766557707574631373[482] = 0;
   out_1766557707574631373[483] = 1;
}
void h_3(double *state, double *unused, double *out_4764363220033308170) {
   out_4764363220033308170[0] = sqrt(pow(state[7], 2) + pow(state[8], 2) + pow(state[9], 2))*state[16];
}
void H_3(double *state, double *unused, double *out_6293854881692266722) {
   out_6293854881692266722[0] = 0;
   out_6293854881692266722[1] = 0;
   out_6293854881692266722[2] = 0;
   out_6293854881692266722[3] = 0;
   out_6293854881692266722[4] = 0;
   out_6293854881692266722[5] = 0;
   out_6293854881692266722[6] = 0;
   out_6293854881692266722[7] = state[7]*state[16]/sqrt(pow(state[7], 2) + pow(state[8], 2) + pow(state[9], 2));
   out_6293854881692266722[8] = state[8]*state[16]/sqrt(pow(state[7], 2) + pow(state[8], 2) + pow(state[9], 2));
   out_6293854881692266722[9] = state[9]*state[16]/sqrt(pow(state[7], 2) + pow(state[8], 2) + pow(state[9], 2));
   out_6293854881692266722[10] = 0;
   out_6293854881692266722[11] = 0;
   out_6293854881692266722[12] = 0;
   out_6293854881692266722[13] = 0;
   out_6293854881692266722[14] = 0;
   out_6293854881692266722[15] = 0;
   out_6293854881692266722[16] = sqrt(pow(state[7], 2) + pow(state[8], 2) + pow(state[9], 2));
   out_6293854881692266722[17] = 0;
   out_6293854881692266722[18] = 0;
   out_6293854881692266722[19] = 0;
   out_6293854881692266722[20] = 0;
   out_6293854881692266722[21] = 0;
   out_6293854881692266722[22] = 0;
}
void h_4(double *state, double *unused, double *out_869294148103320751) {
   out_869294148103320751[0] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(state[12] + state[15]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(state[11] + state[14]) + (state[10] + state[13])*cos(state[21])*cos(state[22]);
   out_869294148103320751[1] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(state[12] + state[15]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(state[11] + state[14]) + (state[10] + state[13])*sin(state[22])*cos(state[21]);
   out_869294148103320751[2] = -(state[10] + state[13])*sin(state[21]) + (state[11] + state[14])*sin(state[20])*cos(state[21]) + (state[12] + state[15])*cos(state[20])*cos(state[21]);
}
void H_4(double *state, double *unused, double *out_7966307925965131092) {
   out_7966307925965131092[0] = 0;
   out_7966307925965131092[1] = 0;
   out_7966307925965131092[2] = 0;
   out_7966307925965131092[3] = 0;
   out_7966307925965131092[4] = 0;
   out_7966307925965131092[5] = 0;
   out_7966307925965131092[6] = 0;
   out_7966307925965131092[7] = 0;
   out_7966307925965131092[8] = 0;
   out_7966307925965131092[9] = 0;
   out_7966307925965131092[10] = cos(state[21])*cos(state[22]);
   out_7966307925965131092[11] = sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]);
   out_7966307925965131092[12] = sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]);
   out_7966307925965131092[13] = cos(state[21])*cos(state[22]);
   out_7966307925965131092[14] = sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]);
   out_7966307925965131092[15] = sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]);
   out_7966307925965131092[16] = 0;
   out_7966307925965131092[17] = 0;
   out_7966307925965131092[18] = 0;
   out_7966307925965131092[19] = 0;
   out_7966307925965131092[20] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(state[11] + state[14]) + (-sin(state[20])*sin(state[21])*cos(state[22]) + sin(state[22])*cos(state[20]))*(state[12] + state[15]);
   out_7966307925965131092[21] = -(state[10] + state[13])*sin(state[21])*cos(state[22]) + (state[11] + state[14])*sin(state[20])*cos(state[21])*cos(state[22]) + (state[12] + state[15])*cos(state[20])*cos(state[21])*cos(state[22]);
   out_7966307925965131092[22] = (sin(state[20])*cos(state[22]) - sin(state[21])*sin(state[22])*cos(state[20]))*(state[12] + state[15]) + (-sin(state[20])*sin(state[21])*sin(state[22]) - cos(state[20])*cos(state[22]))*(state[11] + state[14]) - (state[10] + state[13])*sin(state[22])*cos(state[21]);
   out_7966307925965131092[23] = 0;
   out_7966307925965131092[24] = 0;
   out_7966307925965131092[25] = 0;
   out_7966307925965131092[26] = 0;
   out_7966307925965131092[27] = 0;
   out_7966307925965131092[28] = 0;
   out_7966307925965131092[29] = 0;
   out_7966307925965131092[30] = 0;
   out_7966307925965131092[31] = 0;
   out_7966307925965131092[32] = 0;
   out_7966307925965131092[33] = sin(state[22])*cos(state[21]);
   out_7966307925965131092[34] = sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]);
   out_7966307925965131092[35] = -sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]);
   out_7966307925965131092[36] = sin(state[22])*cos(state[21]);
   out_7966307925965131092[37] = sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]);
   out_7966307925965131092[38] = -sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]);
   out_7966307925965131092[39] = 0;
   out_7966307925965131092[40] = 0;
   out_7966307925965131092[41] = 0;
   out_7966307925965131092[42] = 0;
   out_7966307925965131092[43] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(state[11] + state[14]) + (-sin(state[20])*sin(state[21])*sin(state[22]) - cos(state[20])*cos(state[22]))*(state[12] + state[15]);
   out_7966307925965131092[44] = -(state[10] + state[13])*sin(state[21])*sin(state[22]) + (state[11] + state[14])*sin(state[20])*sin(state[22])*cos(state[21]) + (state[12] + state[15])*sin(state[22])*cos(state[20])*cos(state[21]);
   out_7966307925965131092[45] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(state[12] + state[15]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(state[11] + state[14]) + (state[10] + state[13])*cos(state[21])*cos(state[22]);
   out_7966307925965131092[46] = 0;
   out_7966307925965131092[47] = 0;
   out_7966307925965131092[48] = 0;
   out_7966307925965131092[49] = 0;
   out_7966307925965131092[50] = 0;
   out_7966307925965131092[51] = 0;
   out_7966307925965131092[52] = 0;
   out_7966307925965131092[53] = 0;
   out_7966307925965131092[54] = 0;
   out_7966307925965131092[55] = 0;
   out_7966307925965131092[56] = -sin(state[21]);
   out_7966307925965131092[57] = sin(state[20])*cos(state[21]);
   out_7966307925965131092[58] = cos(state[20])*cos(state[21]);
   out_7966307925965131092[59] = -sin(state[21]);
   out_7966307925965131092[60] = sin(state[20])*cos(state[21]);
   out_7966307925965131092[61] = cos(state[20])*cos(state[21]);
   out_7966307925965131092[62] = 0;
   out_7966307925965131092[63] = 0;
   out_7966307925965131092[64] = 0;
   out_7966307925965131092[65] = 0;
   out_7966307925965131092[66] = (state[11] + state[14])*cos(state[20])*cos(state[21]) - (state[12] + state[15])*sin(state[20])*cos(state[21]);
   out_7966307925965131092[67] = (-state[10] - state[13])*cos(state[21]) - (state[11] + state[14])*sin(state[20])*sin(state[21]) - (state[12] + state[15])*sin(state[21])*cos(state[20]);
   out_7966307925965131092[68] = 0;
}
void h_9(double *state, double *unused, double *out_1800975446315359444) {
   out_1800975446315359444[0] = state[10];
   out_1800975446315359444[1] = state[11];
   out_1800975446315359444[2] = state[12];
}
void H_9(double *state, double *unused, double *out_3839614762528009890) {
   out_3839614762528009890[0] = 0;
   out_3839614762528009890[1] = 0;
   out_3839614762528009890[2] = 0;
   out_3839614762528009890[3] = 0;
   out_3839614762528009890[4] = 0;
   out_3839614762528009890[5] = 0;
   out_3839614762528009890[6] = 0;
   out_3839614762528009890[7] = 0;
   out_3839614762528009890[8] = 0;
   out_3839614762528009890[9] = 0;
   out_3839614762528009890[10] = 1;
   out_3839614762528009890[11] = 0;
   out_3839614762528009890[12] = 0;
   out_3839614762528009890[13] = 0;
   out_3839614762528009890[14] = 0;
   out_3839614762528009890[15] = 0;
   out_3839614762528009890[16] = 0;
   out_3839614762528009890[17] = 0;
   out_3839614762528009890[18] = 0;
   out_3839614762528009890[19] = 0;
   out_3839614762528009890[20] = 0;
   out_3839614762528009890[21] = 0;
   out_3839614762528009890[22] = 0;
   out_3839614762528009890[23] = 0;
   out_3839614762528009890[24] = 0;
   out_3839614762528009890[25] = 0;
   out_3839614762528009890[26] = 0;
   out_3839614762528009890[27] = 0;
   out_3839614762528009890[28] = 0;
   out_3839614762528009890[29] = 0;
   out_3839614762528009890[30] = 0;
   out_3839614762528009890[31] = 0;
   out_3839614762528009890[32] = 0;
   out_3839614762528009890[33] = 0;
   out_3839614762528009890[34] = 1;
   out_3839614762528009890[35] = 0;
   out_3839614762528009890[36] = 0;
   out_3839614762528009890[37] = 0;
   out_3839614762528009890[38] = 0;
   out_3839614762528009890[39] = 0;
   out_3839614762528009890[40] = 0;
   out_3839614762528009890[41] = 0;
   out_3839614762528009890[42] = 0;
   out_3839614762528009890[43] = 0;
   out_3839614762528009890[44] = 0;
   out_3839614762528009890[45] = 0;
   out_3839614762528009890[46] = 0;
   out_3839614762528009890[47] = 0;
   out_3839614762528009890[48] = 0;
   out_3839614762528009890[49] = 0;
   out_3839614762528009890[50] = 0;
   out_3839614762528009890[51] = 0;
   out_3839614762528009890[52] = 0;
   out_3839614762528009890[53] = 0;
   out_3839614762528009890[54] = 0;
   out_3839614762528009890[55] = 0;
   out_3839614762528009890[56] = 0;
   out_3839614762528009890[57] = 0;
   out_3839614762528009890[58] = 1;
   out_3839614762528009890[59] = 0;
   out_3839614762528009890[60] = 0;
   out_3839614762528009890[61] = 0;
   out_3839614762528009890[62] = 0;
   out_3839614762528009890[63] = 0;
   out_3839614762528009890[64] = 0;
   out_3839614762528009890[65] = 0;
   out_3839614762528009890[66] = 0;
   out_3839614762528009890[67] = 0;
   out_3839614762528009890[68] = 0;
}
void h_10(double *state, double *unused, double *out_2005568109157386036) {
   out_2005568109157386036[0] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18]) + (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*cos(state[21])*cos(state[22]);
   out_2005568109157386036[1] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18]) + (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*sin(state[22])*cos(state[21]);
   out_2005568109157386036[2] = (398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19])*cos(state[20])*cos(state[21]) + (398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18])*sin(state[20])*cos(state[21]) - (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*sin(state[21]);
}
void H_10(double *state, double *unused, double *out_3558676140055266778) {
   out_3558676140055266778[0] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]) + (-1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)))*cos(state[21])*cos(state[22]);
   out_3558676140055266778[1] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))) + (-1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[2] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2]) + (-1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[3] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[4] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[5] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]) + (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[6] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]) + (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[7] = 0;
   out_3558676140055266778[8] = 0;
   out_3558676140055266778[9] = 0;
   out_3558676140055266778[10] = 0;
   out_3558676140055266778[11] = 0;
   out_3558676140055266778[12] = 0;
   out_3558676140055266778[13] = 0;
   out_3558676140055266778[14] = 0;
   out_3558676140055266778[15] = 0;
   out_3558676140055266778[16] = 0;
   out_3558676140055266778[17] = cos(state[21])*cos(state[22]);
   out_3558676140055266778[18] = sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]);
   out_3558676140055266778[19] = sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]);
   out_3558676140055266778[20] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18]) + (-sin(state[20])*sin(state[21])*cos(state[22]) + sin(state[22])*cos(state[20]))*(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19]);
   out_3558676140055266778[21] = (398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19])*cos(state[20])*cos(state[21])*cos(state[22]) + (398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18])*sin(state[20])*cos(state[21])*cos(state[22]) - (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*sin(state[21])*cos(state[22]);
   out_3558676140055266778[22] = (sin(state[20])*cos(state[22]) - sin(state[21])*sin(state[22])*cos(state[20]))*(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19]) + (-sin(state[20])*sin(state[21])*sin(state[22]) - cos(state[20])*cos(state[22]))*(398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18]) - (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[23] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]) + (-1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)))*sin(state[22])*cos(state[21]);
   out_3558676140055266778[24] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))) + (-1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[25] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2]) + (-1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[26] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[27] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[28] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]) + (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[29] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]) + (sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]))*(-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]) + (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4])*sin(state[22])*cos(state[21]);
   out_3558676140055266778[30] = 0;
   out_3558676140055266778[31] = 0;
   out_3558676140055266778[32] = 0;
   out_3558676140055266778[33] = 0;
   out_3558676140055266778[34] = 0;
   out_3558676140055266778[35] = 0;
   out_3558676140055266778[36] = 0;
   out_3558676140055266778[37] = 0;
   out_3558676140055266778[38] = 0;
   out_3558676140055266778[39] = 0;
   out_3558676140055266778[40] = sin(state[22])*cos(state[21]);
   out_3558676140055266778[41] = sin(state[20])*sin(state[21])*sin(state[22]) + cos(state[20])*cos(state[22]);
   out_3558676140055266778[42] = -sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]);
   out_3558676140055266778[43] = (-sin(state[20])*cos(state[22]) + sin(state[21])*sin(state[22])*cos(state[20]))*(398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18]) + (-sin(state[20])*sin(state[21])*sin(state[22]) - cos(state[20])*cos(state[22]))*(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19]);
   out_3558676140055266778[44] = (398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19])*sin(state[22])*cos(state[20])*cos(state[21]) + (398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18])*sin(state[20])*sin(state[22])*cos(state[21]) - (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*sin(state[21])*sin(state[22]);
   out_3558676140055266778[45] = (sin(state[20])*sin(state[22]) + sin(state[21])*cos(state[20])*cos(state[22]))*(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19]) + (sin(state[20])*sin(state[21])*cos(state[22]) - sin(state[22])*cos(state[20]))*(398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18]) + (398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[17])*cos(state[21])*cos(state[22]);
   out_3558676140055266778[46] = (-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2])*cos(state[20])*cos(state[21]) + (-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1])*sin(state[20])*cos(state[21]) + (1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] + 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] + 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) - 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)))*sin(state[21]);
   out_3558676140055266778[47] = (-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2])*cos(state[20])*cos(state[21]) + (-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)))*sin(state[20])*cos(state[21]) + (1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] + 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) - 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) + 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1])*sin(state[21]);
   out_3558676140055266778[48] = (-1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2])*sin(state[20])*cos(state[21]) + (1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) - 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) + 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] + 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2])*sin(state[21]) + (-1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)))*cos(state[20])*cos(state[21]);
   out_3558676140055266778[49] = (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5])*sin(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3])*cos(state[20])*cos(state[21]) + (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4])*sin(state[20])*cos(state[21]);
   out_3558676140055266778[50] = (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6])*sin(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3])*sin(state[20])*cos(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4])*cos(state[20])*cos(state[21]);
   out_3558676140055266778[51] = (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5])*cos(state[20])*cos(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6])*sin(state[20])*cos(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3])*sin(state[21]);
   out_3558676140055266778[52] = (-797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5])*sin(state[20])*cos(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6])*cos(state[20])*cos(state[21]) + (797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4])*sin(state[21]);
   out_3558676140055266778[53] = 0;
   out_3558676140055266778[54] = 0;
   out_3558676140055266778[55] = 0;
   out_3558676140055266778[56] = 0;
   out_3558676140055266778[57] = 0;
   out_3558676140055266778[58] = 0;
   out_3558676140055266778[59] = 0;
   out_3558676140055266778[60] = 0;
   out_3558676140055266778[61] = 0;
   out_3558676140055266778[62] = 0;
   out_3558676140055266778[63] = -sin(state[21]);
   out_3558676140055266778[64] = sin(state[20])*cos(state[21]);
   out_3558676140055266778[65] = cos(state[20])*cos(state[21]);
   out_3558676140055266778[66] = -(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19])*sin(state[20])*cos(state[21]) + (398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18])*cos(state[20])*cos(state[21]);
   out_3558676140055266778[67] = -(398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[19])*sin(state[21])*cos(state[20]) - (398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[18])*sin(state[20])*sin(state[21]) + (-398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] - 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] - 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] - state[17])*cos(state[21]);
   out_3558676140055266778[68] = 0;
}
void h_12(double *state, double *unused, double *out_4095445679533609210) {
   out_4095445679533609210[0] = state[0];
   out_4095445679533609210[1] = state[1];
   out_4095445679533609210[2] = state[2];
}
void H_12(double *state, double *unused, double *out_3422364558238493336) {
   out_3422364558238493336[0] = 1;
   out_3422364558238493336[1] = 0;
   out_3422364558238493336[2] = 0;
   out_3422364558238493336[3] = 0;
   out_3422364558238493336[4] = 0;
   out_3422364558238493336[5] = 0;
   out_3422364558238493336[6] = 0;
   out_3422364558238493336[7] = 0;
   out_3422364558238493336[8] = 0;
   out_3422364558238493336[9] = 0;
   out_3422364558238493336[10] = 0;
   out_3422364558238493336[11] = 0;
   out_3422364558238493336[12] = 0;
   out_3422364558238493336[13] = 0;
   out_3422364558238493336[14] = 0;
   out_3422364558238493336[15] = 0;
   out_3422364558238493336[16] = 0;
   out_3422364558238493336[17] = 0;
   out_3422364558238493336[18] = 0;
   out_3422364558238493336[19] = 0;
   out_3422364558238493336[20] = 0;
   out_3422364558238493336[21] = 0;
   out_3422364558238493336[22] = 0;
   out_3422364558238493336[23] = 0;
   out_3422364558238493336[24] = 1;
   out_3422364558238493336[25] = 0;
   out_3422364558238493336[26] = 0;
   out_3422364558238493336[27] = 0;
   out_3422364558238493336[28] = 0;
   out_3422364558238493336[29] = 0;
   out_3422364558238493336[30] = 0;
   out_3422364558238493336[31] = 0;
   out_3422364558238493336[32] = 0;
   out_3422364558238493336[33] = 0;
   out_3422364558238493336[34] = 0;
   out_3422364558238493336[35] = 0;
   out_3422364558238493336[36] = 0;
   out_3422364558238493336[37] = 0;
   out_3422364558238493336[38] = 0;
   out_3422364558238493336[39] = 0;
   out_3422364558238493336[40] = 0;
   out_3422364558238493336[41] = 0;
   out_3422364558238493336[42] = 0;
   out_3422364558238493336[43] = 0;
   out_3422364558238493336[44] = 0;
   out_3422364558238493336[45] = 0;
   out_3422364558238493336[46] = 0;
   out_3422364558238493336[47] = 0;
   out_3422364558238493336[48] = 1;
   out_3422364558238493336[49] = 0;
   out_3422364558238493336[50] = 0;
   out_3422364558238493336[51] = 0;
   out_3422364558238493336[52] = 0;
   out_3422364558238493336[53] = 0;
   out_3422364558238493336[54] = 0;
   out_3422364558238493336[55] = 0;
   out_3422364558238493336[56] = 0;
   out_3422364558238493336[57] = 0;
   out_3422364558238493336[58] = 0;
   out_3422364558238493336[59] = 0;
   out_3422364558238493336[60] = 0;
   out_3422364558238493336[61] = 0;
   out_3422364558238493336[62] = 0;
   out_3422364558238493336[63] = 0;
   out_3422364558238493336[64] = 0;
   out_3422364558238493336[65] = 0;
   out_3422364558238493336[66] = 0;
   out_3422364558238493336[67] = 0;
   out_3422364558238493336[68] = 0;
}
void h_13(double *state, double *unused, double *out_9213323650548886526) {
   out_9213323650548886526[0] = (-2*state[3]*state[5] + 2*state[4]*state[6])*state[9] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[8] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[7];
   out_9213323650548886526[1] = (2*state[3]*state[4] + 2*state[5]*state[6])*state[9] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[7] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[8];
   out_9213323650548886526[2] = (-2*state[3]*state[4] + 2*state[5]*state[6])*state[8] + (2*state[3]*state[5] + 2*state[4]*state[6])*state[7] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[9];
}
void H_13(double *state, double *unused, double *out_478573194713041427) {
   out_478573194713041427[0] = 0;
   out_478573194713041427[1] = 0;
   out_478573194713041427[2] = 0;
   out_478573194713041427[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8];
   out_478573194713041427[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
   out_478573194713041427[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7];
   out_478573194713041427[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7];
   out_478573194713041427[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2);
   out_478573194713041427[8] = 2*state[3]*state[6] + 2*state[4]*state[5];
   out_478573194713041427[9] = -2*state[3]*state[5] + 2*state[4]*state[6];
   out_478573194713041427[10] = 0;
   out_478573194713041427[11] = 0;
   out_478573194713041427[12] = 0;
   out_478573194713041427[13] = 0;
   out_478573194713041427[14] = 0;
   out_478573194713041427[15] = 0;
   out_478573194713041427[16] = 0;
   out_478573194713041427[17] = 0;
   out_478573194713041427[18] = 0;
   out_478573194713041427[19] = 0;
   out_478573194713041427[20] = 0;
   out_478573194713041427[21] = 0;
   out_478573194713041427[22] = 0;
   out_478573194713041427[23] = 0;
   out_478573194713041427[24] = 0;
   out_478573194713041427[25] = 0;
   out_478573194713041427[26] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7];
   out_478573194713041427[27] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7];
   out_478573194713041427[28] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
   out_478573194713041427[29] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8];
   out_478573194713041427[30] = -2*state[3]*state[6] + 2*state[4]*state[5];
   out_478573194713041427[31] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2);
   out_478573194713041427[32] = 2*state[3]*state[4] + 2*state[5]*state[6];
   out_478573194713041427[33] = 0;
   out_478573194713041427[34] = 0;
   out_478573194713041427[35] = 0;
   out_478573194713041427[36] = 0;
   out_478573194713041427[37] = 0;
   out_478573194713041427[38] = 0;
   out_478573194713041427[39] = 0;
   out_478573194713041427[40] = 0;
   out_478573194713041427[41] = 0;
   out_478573194713041427[42] = 0;
   out_478573194713041427[43] = 0;
   out_478573194713041427[44] = 0;
   out_478573194713041427[45] = 0;
   out_478573194713041427[46] = 0;
   out_478573194713041427[47] = 0;
   out_478573194713041427[48] = 0;
   out_478573194713041427[49] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7];
   out_478573194713041427[50] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7];
   out_478573194713041427[51] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8];
   out_478573194713041427[52] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
   out_478573194713041427[53] = 2*state[3]*state[5] + 2*state[4]*state[6];
   out_478573194713041427[54] = -2*state[3]*state[4] + 2*state[5]*state[6];
   out_478573194713041427[55] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2);
   out_478573194713041427[56] = 0;
   out_478573194713041427[57] = 0;
   out_478573194713041427[58] = 0;
   out_478573194713041427[59] = 0;
   out_478573194713041427[60] = 0;
   out_478573194713041427[61] = 0;
   out_478573194713041427[62] = 0;
   out_478573194713041427[63] = 0;
   out_478573194713041427[64] = 0;
   out_478573194713041427[65] = 0;
   out_478573194713041427[66] = 0;
   out_478573194713041427[67] = 0;
   out_478573194713041427[68] = 0;
}
void h_14(double *state, double *unused, double *out_1800975446315359444) {
   out_1800975446315359444[0] = state[10];
   out_1800975446315359444[1] = state[11];
   out_1800975446315359444[2] = state[12];
}
void H_14(double *state, double *unused, double *out_3839614762528009890) {
   out_3839614762528009890[0] = 0;
   out_3839614762528009890[1] = 0;
   out_3839614762528009890[2] = 0;
   out_3839614762528009890[3] = 0;
   out_3839614762528009890[4] = 0;
   out_3839614762528009890[5] = 0;
   out_3839614762528009890[6] = 0;
   out_3839614762528009890[7] = 0;
   out_3839614762528009890[8] = 0;
   out_3839614762528009890[9] = 0;
   out_3839614762528009890[10] = 1;
   out_3839614762528009890[11] = 0;
   out_3839614762528009890[12] = 0;
   out_3839614762528009890[13] = 0;
   out_3839614762528009890[14] = 0;
   out_3839614762528009890[15] = 0;
   out_3839614762528009890[16] = 0;
   out_3839614762528009890[17] = 0;
   out_3839614762528009890[18] = 0;
   out_3839614762528009890[19] = 0;
   out_3839614762528009890[20] = 0;
   out_3839614762528009890[21] = 0;
   out_3839614762528009890[22] = 0;
   out_3839614762528009890[23] = 0;
   out_3839614762528009890[24] = 0;
   out_3839614762528009890[25] = 0;
   out_3839614762528009890[26] = 0;
   out_3839614762528009890[27] = 0;
   out_3839614762528009890[28] = 0;
   out_3839614762528009890[29] = 0;
   out_3839614762528009890[30] = 0;
   out_3839614762528009890[31] = 0;
   out_3839614762528009890[32] = 0;
   out_3839614762528009890[33] = 0;
   out_3839614762528009890[34] = 1;
   out_3839614762528009890[35] = 0;
   out_3839614762528009890[36] = 0;
   out_3839614762528009890[37] = 0;
   out_3839614762528009890[38] = 0;
   out_3839614762528009890[39] = 0;
   out_3839614762528009890[40] = 0;
   out_3839614762528009890[41] = 0;
   out_3839614762528009890[42] = 0;
   out_3839614762528009890[43] = 0;
   out_3839614762528009890[44] = 0;
   out_3839614762528009890[45] = 0;
   out_3839614762528009890[46] = 0;
   out_3839614762528009890[47] = 0;
   out_3839614762528009890[48] = 0;
   out_3839614762528009890[49] = 0;
   out_3839614762528009890[50] = 0;
   out_3839614762528009890[51] = 0;
   out_3839614762528009890[52] = 0;
   out_3839614762528009890[53] = 0;
   out_3839614762528009890[54] = 0;
   out_3839614762528009890[55] = 0;
   out_3839614762528009890[56] = 0;
   out_3839614762528009890[57] = 0;
   out_3839614762528009890[58] = 1;
   out_3839614762528009890[59] = 0;
   out_3839614762528009890[60] = 0;
   out_3839614762528009890[61] = 0;
   out_3839614762528009890[62] = 0;
   out_3839614762528009890[63] = 0;
   out_3839614762528009890[64] = 0;
   out_3839614762528009890[65] = 0;
   out_3839614762528009890[66] = 0;
   out_3839614762528009890[67] = 0;
   out_3839614762528009890[68] = 0;
}
void h_19(double *state, double *unused, double *out_8083511536625772422) {
   out_8083511536625772422[0] = state[20];
   out_8083511536625772422[1] = state[21];
   out_8083511536625772422[2] = state[22];
}
void H_19(double *state, double *unused, double *out_8272294613630441071) {
   out_8272294613630441071[0] = 0;
   out_8272294613630441071[1] = 0;
   out_8272294613630441071[2] = 0;
   out_8272294613630441071[3] = 0;
   out_8272294613630441071[4] = 0;
   out_8272294613630441071[5] = 0;
   out_8272294613630441071[6] = 0;
   out_8272294613630441071[7] = 0;
   out_8272294613630441071[8] = 0;
   out_8272294613630441071[9] = 0;
   out_8272294613630441071[10] = 0;
   out_8272294613630441071[11] = 0;
   out_8272294613630441071[12] = 0;
   out_8272294613630441071[13] = 0;
   out_8272294613630441071[14] = 0;
   out_8272294613630441071[15] = 0;
   out_8272294613630441071[16] = 0;
   out_8272294613630441071[17] = 0;
   out_8272294613630441071[18] = 0;
   out_8272294613630441071[19] = 0;
   out_8272294613630441071[20] = 1;
   out_8272294613630441071[21] = 0;
   out_8272294613630441071[22] = 0;
   out_8272294613630441071[23] = 0;
   out_8272294613630441071[24] = 0;
   out_8272294613630441071[25] = 0;
   out_8272294613630441071[26] = 0;
   out_8272294613630441071[27] = 0;
   out_8272294613630441071[28] = 0;
   out_8272294613630441071[29] = 0;
   out_8272294613630441071[30] = 0;
   out_8272294613630441071[31] = 0;
   out_8272294613630441071[32] = 0;
   out_8272294613630441071[33] = 0;
   out_8272294613630441071[34] = 0;
   out_8272294613630441071[35] = 0;
   out_8272294613630441071[36] = 0;
   out_8272294613630441071[37] = 0;
   out_8272294613630441071[38] = 0;
   out_8272294613630441071[39] = 0;
   out_8272294613630441071[40] = 0;
   out_8272294613630441071[41] = 0;
   out_8272294613630441071[42] = 0;
   out_8272294613630441071[43] = 0;
   out_8272294613630441071[44] = 1;
   out_8272294613630441071[45] = 0;
   out_8272294613630441071[46] = 0;
   out_8272294613630441071[47] = 0;
   out_8272294613630441071[48] = 0;
   out_8272294613630441071[49] = 0;
   out_8272294613630441071[50] = 0;
   out_8272294613630441071[51] = 0;
   out_8272294613630441071[52] = 0;
   out_8272294613630441071[53] = 0;
   out_8272294613630441071[54] = 0;
   out_8272294613630441071[55] = 0;
   out_8272294613630441071[56] = 0;
   out_8272294613630441071[57] = 0;
   out_8272294613630441071[58] = 0;
   out_8272294613630441071[59] = 0;
   out_8272294613630441071[60] = 0;
   out_8272294613630441071[61] = 0;
   out_8272294613630441071[62] = 0;
   out_8272294613630441071[63] = 0;
   out_8272294613630441071[64] = 0;
   out_8272294613630441071[65] = 0;
   out_8272294613630441071[66] = 0;
   out_8272294613630441071[67] = 0;
   out_8272294613630441071[68] = 1;
}
}

extern "C"{
#define DIM 23
#define EDIM 22
#define MEDIM 22
typedef void (*Hfun)(double *, double *, double *);

void predict(double *x, double *P, double *Q, double dt);
const static double MAHA_THRESH_3 = 3.841459;
void update_3(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_4 = 7.814728;
void update_4(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_9 = 7.814728;
void update_9(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_10 = 7.814728;
void update_10(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_12 = 7.814728;
void update_12(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_13 = 7.814728;
void update_13(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_14 = 7.814728;
void update_14(double *, double *, double *, double *, double *);
const static double MAHA_THRESH_19 = 7.814728;
void update_19(double *, double *, double *, double *, double *);
}

#include <eigen3/Eigen/Dense>
#include <iostream>

typedef Eigen::Matrix<double, DIM, DIM, Eigen::RowMajor> DDM;
typedef Eigen::Matrix<double, EDIM, EDIM, Eigen::RowMajor> EEM;
typedef Eigen::Matrix<double, DIM, EDIM, Eigen::RowMajor> DEM;

void predict(double *in_x, double *in_P, double *in_Q, double dt) {
  typedef Eigen::Matrix<double, MEDIM, MEDIM, Eigen::RowMajor> RRM;
  
  double nx[DIM] = {0};
  double in_F[EDIM*EDIM] = {0};

  // functions from sympy
  f_fun(in_x, dt, nx);
  F_fun(in_x, dt, in_F);


  EEM F(in_F);
  EEM P(in_P);
  EEM Q(in_Q);

  RRM F_main = F.topLeftCorner(MEDIM, MEDIM);
  P.topLeftCorner(MEDIM, MEDIM) = (F_main * P.topLeftCorner(MEDIM, MEDIM)) * F_main.transpose();
  P.topRightCorner(MEDIM, EDIM - MEDIM) = F_main * P.topRightCorner(MEDIM, EDIM - MEDIM);
  P.bottomLeftCorner(EDIM - MEDIM, MEDIM) = P.bottomLeftCorner(EDIM - MEDIM, MEDIM) * F_main.transpose();

  P = P + dt*Q;

  // copy out state
  memcpy(in_x, nx, DIM * sizeof(double));
  memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double));
}

// note: extra_args dim only correct when null space projecting
// otherwise 1
template <int ZDIM, int EADIM, bool MAHA_TEST>
void update(double *in_x, double *in_P, Hfun h_fun, Hfun H_fun, Hfun Hea_fun, double *in_z, double *in_R, double *in_ea, double MAHA_THRESHOLD) {
  typedef Eigen::Matrix<double, ZDIM, ZDIM, Eigen::RowMajor> ZZM;
  typedef Eigen::Matrix<double, ZDIM, DIM, Eigen::RowMajor> ZDM;
  typedef Eigen::Matrix<double, Eigen::Dynamic, EDIM, Eigen::RowMajor> XEM;
  //typedef Eigen::Matrix<double, EDIM, ZDIM, Eigen::RowMajor> EZM;
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> X1M;
  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> XXM;

  double in_hx[ZDIM] = {0};
  double in_H[ZDIM * DIM] = {0};
  double in_H_mod[EDIM * DIM] = {0};
  double delta_x[EDIM] = {0};
  double x_new[DIM] = {0};


  // state x, P
  Eigen::Matrix<double, ZDIM, 1> z(in_z);
  EEM P(in_P);
  ZZM pre_R(in_R);
  
  // functions from sympy
  h_fun(in_x, in_ea, in_hx);
  H_fun(in_x, in_ea, in_H);
  ZDM pre_H(in_H); 
  
  // get y (y = z - hx)
  Eigen::Matrix<double, ZDIM, 1> pre_y(in_hx); pre_y = z - pre_y;
  X1M y; XXM H; XXM R;
  if (Hea_fun){
    typedef Eigen::Matrix<double, ZDIM, EADIM, Eigen::RowMajor> ZAM;
    double in_Hea[ZDIM * EADIM] = {0};
    Hea_fun(in_x, in_ea, in_Hea);
    ZAM Hea(in_Hea);
    XXM A = Hea.transpose().fullPivLu().kernel();
   

    y = A.transpose() * pre_y;
    H = A.transpose() * pre_H;
    R = A.transpose() * pre_R * A;
  } else {
    y = pre_y;
    H = pre_H;
    R = pre_R;
  }
  // get modified H
  H_mod_fun(in_x, in_H_mod);
  DEM H_mod(in_H_mod);
  XEM H_err = H * H_mod;
  
  // Do mahalobis distance test
  if (MAHA_TEST){
    XXM a = (H_err * P * H_err.transpose() + R).inverse();
    double maha_dist = y.transpose() * a * y;
    if (maha_dist > MAHA_THRESHOLD){
      R = 1.0e16 * R;
    }
  }

  // Outlier resilient weighting
  double weight = 1;//(1.5)/(1 + y.squaredNorm()/R.sum());

  // kalman gains and I_KH
  XXM S = ((H_err * P) * H_err.transpose()) + R/weight;
  XEM KT = S.fullPivLu().solve(H_err * P.transpose());
  //EZM K = KT.transpose(); TODO: WHY DOES THIS NOT COMPILE?
  //EZM K = S.fullPivLu().solve(H_err * P.transpose()).transpose();
  //std::cout << "Here is the matrix rot:\n" << K << std::endl;
  EEM I_KH = Eigen::Matrix<double, EDIM, EDIM>::Identity() - (KT.transpose() * H_err);

  // update state by injecting dx
  Eigen::Matrix<double, EDIM, 1> dx(delta_x);
  dx  = (KT.transpose() * y);
  memcpy(delta_x, dx.data(), EDIM * sizeof(double));
  err_fun(in_x, delta_x, x_new);
  Eigen::Matrix<double, DIM, 1> x(x_new);
 
  // update cov 
  P = ((I_KH * P) * I_KH.transpose()) + ((KT.transpose() * R) * KT);

  // copy out state
  memcpy(in_x, x.data(), DIM * sizeof(double));
  memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double));
  memcpy(in_z, y.data(), y.rows() * sizeof(double));
}



extern "C"{

      void update_3(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<1,3,0>(in_x, in_P, h_3, H_3, NULL, in_z, in_R, in_ea, MAHA_THRESH_3);
      }
    
      void update_4(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_4, H_4, NULL, in_z, in_R, in_ea, MAHA_THRESH_4);
      }
    
      void update_9(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_9, H_9, NULL, in_z, in_R, in_ea, MAHA_THRESH_9);
      }
    
      void update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_10, H_10, NULL, in_z, in_R, in_ea, MAHA_THRESH_10);
      }
    
      void update_12(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_12, H_12, NULL, in_z, in_R, in_ea, MAHA_THRESH_12);
      }
    
      void update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_13, H_13, NULL, in_z, in_R, in_ea, MAHA_THRESH_13);
      }
    
      void update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_14, H_14, NULL, in_z, in_R, in_ea, MAHA_THRESH_14);
      }
    
      void update_19(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
        update<3,3,0>(in_x, in_P, h_19, H_19, NULL, in_z, in_R, in_ea, MAHA_THRESH_19);
      }
    
}
